package com.suray.system.run.lifter;

import com.suray.basic.wcs.plc.pojo.oper.lifter.LifterOper;
import com.suray.system.run.data.LifterInformation;
import com.suray.system.run.data.mysql.analyze.MonitorDataStore;
import com.suray.wcs.service.util.WcsUtil;

public class LifterMonitor {
    private LifterOper lifterOper;

    private LifterMonitorAction lifterMonitorAction;

    public LifterMonitor(LifterOper lifterOper, LifterInformation lifterInformation,
                         MonitorDataStore monitorDataStore) {
        this.lifterOper = lifterOper;
        lifterMonitorAction = new LifterMonitorAction(lifterOper, lifterInformation, monitorDataStore);
    }

    public void init() {
        lifterMonitorAction.init();
    }

    public void run() {
        try {
            lifterMonitorAction.run();
        } catch (Exception e) {
            WcsUtil.exceptionLog(e, this.getClass());
        }
    }

    public String getRgvName() {
        return lifterOper.getDeviceName();
    }
}
